# -*- coding: utf-8 -*-
# @Time    : 2025/8/12 12:00
# @Author  : FuKai ZHANG
# @File    : yaml_saver.py
# @Description :
import os

def save_yaml(module, op_id, yaml_content, output_dir):
    """
    保存 YAML 到文件，按模块组织。
    """
    module_dir = os.path.join(output_dir, module)
    os.makedirs(module_dir, exist_ok=True)
    file_path = os.path.join(module_dir, f"{op_id}.yaml")
    with open(file_path, 'w', encoding='utf-8') as f:
        f.write(yaml_content)
    print(f"生成文件: {file_path}")